home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Core Concepts in Art 2
/
Core Concepts in Art (Frames of Reference)(The McGraw-Hill Companies)(2004).iso
/
mac
/
media
/
main.swf
/
scripts
/
frame_1
/
DoAction.as
< prev
Wrap
Text File
|
2003-11-02
|
15KB
|
551 lines
function hideTitles(except)
{
var i = 0;
while(i < 13)
{
if(i < except || i > except)
{
this[optionsArray[i] + "Title_mc"]._visible = 0;
}
this[optionsArray[except] + "Title_mc"]._visible = 1;
i++;
}
}
function hideMenus(except1, except2)
{
var i = 0;
while(i < 4)
{
if(i == except1 || i == except2)
{
this[menuArray[i]]._visible = 1;
}
else
{
this[menuArray[i]]._visible = 0;
}
i++;
}
}
function hideLayer(except)
{
var i = 0;
while(i < 7)
{
if(i == except)
{
this[layerArray[i]]._visible = 1;
}
else
{
this[layerArray[i]]._visible = 0;
}
i++;
}
}
function disableButton(whichMenu, whichButton)
{
i = 0;
while(i < menuArray.length)
{
j = 0;
while(j < optionsArray.length)
{
if(i == whichMenu && j == whichButton)
{
this[menuArray[i]][optionsArray[j] + "_btn"]._visible = 0;
this[menuArray[i]][optionsArray[j] + "Img_mc"]._alpha = 30;
this[menuArray[i]][optionsArray[j] + "_txt"]._alpha = 40;
}
else
{
this[menuArray[i]][optionsArray[j] + "_btn"]._visible = 1;
this[menuArray[i]][optionsArray[j] + "Img_mc"]._alpha = 80;
this[menuArray[i]][optionsArray[j] + "_txt"]._alpha = 100;
}
j++;
}
i++;
}
}
function loadLayer(whichLayer)
{
pleaseSave_mc._visible = 0;
ph._visible = 0;
makeLarge();
this[whichLayer + "_mc"]._visible = 1;
link1_mc._y = 525;
if(whichLayer == "newOpen")
{
hideTitles(11);
hideLayer(0);
hideMenus(1,3);
link1_mc._y = 553;
disableButton(4,4);
}
else if(whichLayer == "new")
{
checkForAnotherFile("new");
hideTitles(6);
hideLayer(1);
hideMenus(1,3);
link1_mc._y = 553;
disableButton(3,6);
}
else if(whichLayer == "open")
{
checkForAnotherFile("open");
hideTitles(7);
hideLayer(2);
hideMenus(1,3);
link1_mc._y = 553;
disableButton(3,7);
}
else if(whichLayer == "save")
{
hideTitles(10);
hideLayer(3);
link1_mc._y = 553;
hideMenus(1,3);
disableButton(3,10);
}
else if(whichLayer == "print")
{
hideTitles(8);
hideLayer(4);
hideMenus(1,3);
link1_mc._y = 553;
disableButton(3,8);
}
else if(whichLayer == "sawyer")
{
hideTitles(11);
hideLayer(6);
hideMenus(0,3);
disableButton(4,4);
}
else if(whichLayer == "start")
{
hideTitles(11);
hideLayer(5);
hideMenus(4,4);
disableButton(4,4);
whereFrom = undefined;
}
checkForVariables();
}
function loadPage(whichSWF)
{
pleaseSave_mc._visible = 0;
ph._visible = 1;
link1_mc._y = 525;
hideLayer(6);
loadMovie(whichSWF + ".swf","ph");
whereFrom = whichSWF;
if(whichSWF == "create")
{
hideTitles(0);
hideMenus(2,3);
link1_mc._y = 553;
link1_mc._visible = 1;
disableButton(2,0);
makeLarge();
}
else if(whichSWF == "delete")
{
hideTitles(1);
hideMenus(2,3);
link1_mc._y = 553;
link1_mc._visible = 1;
disableButton(2,1);
makeLarge();
}
else if(whichSWF == "generator")
{
hideTitles(2);
hideMenus(1,3);
disableButton(1,2);
makeSmall();
}
else if(whichSWF == "guess")
{
hideTitles(3);
hideMenus(1,3);
disableButton(1,3);
makeSmall();
}
else if(whichSWF == "help")
{
hideTitles(4);
hideMenus(1,3);
disableButton(1,4);
makeSmall();
}
else if(whichSWF == "modify")
{
hideTitles(5);
hideMenus(2,3);
link1_mc._y = 553;
link1_mc._visible = 1;
disableButton(2,5);
makeLarge();
}
else if(whichSWF == "print")
{
hideTitles(8);
hideMenus(1,3);
link1_mc._y = 553;
disableButton(3,8);
makeLarge();
}
else if(whichSWF == "quiz")
{
hideTitles(9);
hideMenus(1,3);
link1_mc._y = 553;
disableButton(1,9);
makeLarge();
}
else if(whichSWF == "sawyer")
{
hideTitles(11);
hideMenus(1,3);
disableButton(1,11);
makeSmall();
}
else if(whichSWF == "search")
{
calculateChapterImages();
hideTitles(12);
hideMenus(1,3);
disableButton(1,12);
makeSmall();
}
checkForVariables();
}
function makeSmall()
{
bevel_mc._height = 340;
}
function makeLarge()
{
bevel_mc._height = 375;
}
function doRollOver(whichMovieClip, whichButton)
{
this[whichMovieClip + "_mc"][whichButton + "Img_mc"]._alpha = 100;
textColor = new Color(eval(whichMovieClip + "_mc." + whichButton + "_txt"));
if(whichMovieClip == "link1" && outterLinkRollColor != undefined || whichMovieClip == "link2" && outterLinkRollColor != undefined || whichMovieClip == "link3" && outterLinkRollColor != undefined)
{
textColor.setRGB(outterLinkRollColor);
}
else
{
textColor.setRGB(rollColor);
}
getUrl("lingo: cursor 280", "");
}
function doRollOut(whichMovieClip, whichButton)
{
if(this[whichMovieClip + "_mc"][whichButton + "_btn"]._visible == 1)
{
this[whichMovieClip + "_mc"][whichButton + "Img_mc"]._alpha = 75;
}
if(whichMovieClip == "link1" && outterLinkRestColor != undefined || whichMovieClip == "link2" && outterLinkRestColor != undefined || whichMovieClip == "link3" && outterLinkRestColor != undefined)
{
textColor.setRGB(outterLinkRestColor);
}
else
{
textColor.setRGB(restColor);
}
getUrl("lingo: cursor -1", "");
}
function simpleRollOver()
{
getUrl("lingo: cursor 280", "");
}
function simpleRollOut()
{
getUrl("lingo: cursor -1", "");
}
function seperatePath()
{
fileLoc.toString();
var isItPC = fileLoc.indexOf("\\");
if(isItPC != -1)
{
whereToCut = fileLoc.lastIndexOf("\\");
masterFileName = fileLoc.slice(whereToCut + 1,fileLoc.length);
filePath = fileLoc.slice(0,whereToCut + 1);
}
else
{
whereToCut = fileLoc.lastIndexOf(":");
masterFileName = fileLoc.slice(whereToCut + 1,fileLoc.length);
filePath = fileLoc.slice(0,whereToCut + 1);
}
originalFileLoc = fileLoc;
originalMasterFileName = undefined;
originalFilePath = undefined;
}
function tempPath()
{
fileLoc.toString();
var isItPC = fileLoc.indexOf("\\");
if(isItPC != -1)
{
whereToCut = fileLoc.lastIndexOf("\\");
originalMasterFileName = masterFileName;
masterFileName = fileLoc.slice(whereToCut + 1,fileLoc.length);
originalFilePath = filePath;
filePath = fileLoc.slice(0,whereToCut + 1);
}
else
{
whereToCut = fileLoc.lastIndexOf(":");
originalMasterFileName = masterFileName;
masterFileName = fileLoc.slice(whereToCut + 1,fileLoc.length);
originalFilePath = filePath;
filePath = fileLoc.slice(0,whereToCut + 1);
}
}
function resetFileLoc()
{
if(originalFilePath != undefined)
{
fileLoc = originalFileLoc;
seperatePath();
}
}
function checkForVariables()
{
resetFileLoc();
if(generatorArray == undefined || generatorArray.length == 0)
{
i = 0;
while(i < menuArray.length)
{
j = 0;
while(j < optionsArray.length)
{
if(this[menuArray[i]][optionsArray[j] + "_btn"]._visible == 1)
{
if(i == 0 && j == 9 || i == 1 && j == 9 || i == 2 && j == 1 || i == 2 && j == 5 || i == 3 && j == 8)
{
this[menuArray[i]][optionsArray[j] + "_btn"]._visible = 0;
this[menuArray[i]][optionsArray[j] + "Img_mc"]._alpha = 35;
this[menuArray[i]][optionsArray[j] + "_txt"]._alpha = 60;
}
else
{
this[menuArray[i]][optionsArray[j] + "_btn"]._visible = 1;
this[menuArray[i]][optionsArray[j] + "Img_mc"]._alpha = 75;
this[menuArray[i]][optionsArray[j] + "_txt"]._alpha = 100;
}
}
j++;
}
i++;
}
}
else
{
i = 0;
while(i < menuArray.length)
{
j = 0;
while(j < optionsArray.length)
{
if(this[menuArray[i]][optionsArray[j] + "_btn"]._visible == 1)
{
this[menuArray[i]][optionsArray[j] + "_btn"]._visible = 1;
this[menuArray[i]][optionsArray[j] + "Img_mc"]._alpha = 80;
this[menuArray[i]][optionsArray[j] + "_txt"]._alpha = 100;
}
j++;
}
i++;
}
}
}
function help()
{
if(ph._visible == 1)
{
if(whichSWF != "create")
{
if(whichSWF != "delete")
{
if(whichSWF != "generator")
{
if(whichSWF != "guess")
{
if(whichSWF != "help")
{
if(whichSWF != "modify")
{
if(whichSWF != "print")
{
if(whichSWF != "quiz")
{
if(whichSWF != "sawyer")
{
if(whichSWF == "search")
{
}
}
}
}
}
}
}
}
}
}
}
else if(ph._visible == 0)
{
if(whichLayer != "newOpen")
{
if(whichLayer != "new")
{
if(whichLayer != "open")
{
if(whichLayer != "save")
{
if(whichLayer != "print")
{
if(whichLayer != "sawyer")
{
if(whichLayer == "start")
{
}
}
}
}
}
}
}
}
}
function createArray(whichArray, whatToBecome)
{
var count = 0;
if(_root[whatToBecome] == undefined)
{
_root[whatToBecome] = new Array();
_root.flashcardArray = new Array();
}
i = 0;
while(i < 40)
{
this["chap" + i] = new Array();
this["altChap" + i] = new Array();
i++;
}
i = 0;
while(i < refineMasterFile_mc.arrayFromGenerator.length)
{
if(refineMasterFile_mc.arrayFromGenerator.charAt(i) == "\"" && refineMasterFile_mc.arrayFromGenerator.charAt(i + 1) != "," && refineMasterFile_mc.arrayFromGenerator.charAt(i + 1) != "]")
{
if(refineMasterFile_mc.arrayFromGenerator.charAt(i + 1) == "\"")
{
this["chap" + count] = "";
this["altChap" + count] = "";
}
else
{
stop = 0;
j = i + 1;
while(j < refineMasterFile_mc.arrayFromGenerator.length)
{
if(refineMasterFile_mc.arrayFromGenerator.charAt(j) != "\"" && stop != 1)
{
if(refineMasterFile_mc.arrayFromGenerator.charAt(j) != ",")
{
if(refineMasterFile_mc.arrayFromGenerator.charAt(j + 1) != "," && refineMasterFile_mc.arrayFromGenerator.charAt(j + 1) != "\"")
{
this["chap" + count].push(refineMasterFile_mc.arrayFromGenerator.charAt(j) + refineMasterFile_mc.arrayFromGenerator.charAt(j + 1));
this["altChap" + count].push(refineMasterFile_mc.arrayFromGenerator.charAt(j) + refineMasterFile_mc.arrayFromGenerator.charAt(j + 1));
j += 1;
}
else
{
this["chap" + count].push(refineMasterFile_mc.arrayFromGenerator.charAt(j));
this["altChap" + count].push(refineMasterFile_mc.arrayFromGenerator.charAt(j));
}
}
}
else if(refineMasterFile_mc.arrayFromGenerator.charAt(j) == "\"" && stop != 1)
{
var numberOfSlots = this["chap" + count][0];
this["chap" + count].shift();
this["chap" + count].sort(numerical);
findWhatsMissing(numberOfSlots,this["chap" + count]);
stop = 1;
}
j++;
}
}
_root[whatToBecome].push(this["chap" + count]);
_root.flashcardArray.push(this["altChap" + count]);
count++;
}
i++;
}
loading_mc._visible = 0;
getUrl("lingo: cursor -1", "");
if(whereFrom != undefined)
{
loadPage(whereFrom);
}
else
{
loadLayer("sawyer");
}
}
function findWhatsMissing(theNumber, theArray)
{
if(questionsWithImages == undefined)
{
questionsWithImages = new Array();
questionsWithImages.push("");
}
var tempNumHolder = new Array();
var k = 1;
while(k <= theNumber)
{
tempNumHolder.push(k);
var l = 0;
while(l < theArray.length)
{
if(k == theArray[l])
{
tempNumHolder.pop();
}
l++;
}
k++;
}
questionsWithImages.push(tempNumHolder);
}
function numerical(element1, element2)
{
return element1 - element2;
}
function checkForAnotherFile(whichSection)
{
if(generatorArray != undefined)
{
pleaseSave_mc._visible = 1;
this[whichSection + "Page_mc"].cancel_btn._visible = 0;
this[whichSection + "Page_mc"].browse_btn._visible = 0;
this[whichSection + "Page_mc"].ok_btn._visible = 0;
}
}
system.useCodepage = true;
var menuArray = new Array("link0_mc","link1_mc","link2_mc","link3_mc");
var optionsArray = new Array("create","delete","generator","guess","help","modify","new","open","print","quiz","save","sawyer","search");
var layerArray = new Array("newOpenPage_mc","newPage_mc","openPage_mc","savePage_mc","printPage_mc","start_mc");